<?php
App::uses('AppModel', 'Model');
class ShipperDiffModel extends Model {
    public $useTable = 'm_diff_shipper';

    // Use primaryKey
    public $primaryKey = 'id';

    public function getInfoFrmShipperDiff() {
        $params = array();
        // Set fields params
        $params['fields'] = array(	
        						   'ShipperDiffModel.id',
        						   'ShipperDiffModel.shipper_cd'
                                   );
        return $this->find('all', $params);
    }

 	public function getInfoFrmShipperDiffReport() {
        $params = array();
        // Set fields params
        // Set joins array
        $params = array(
                'joins' => array(
                        array(
                                'table'      => 'm_shipper',
                                'alias'      => 'ShipperModel',
                                'type'       => 'LEFT',
                                'foreignKey' => FALSE,
                                'conditions' => array(
                                        'ShipperModel.shipper_cd = ShipperDiffModel.shipper_cd'
                                )
                        ),
                )
        );	
        $params['fields'] = array(	
        						   'ShipperDiffModel.id',
        						   'ShipperDiffModel.shipper_cd,ShipperModel.shipper_name');									   
        return $this->find('all', $params);
    }	
	
}
